project(cgm_facetbool)

set(facetbool_srcs
  FBClassify.cpp
  FBDataUtil.cpp
  FBImprint.cpp
  FBIntersect.cpp
  FBPolyhedron.cpp
  FBRetriangulate.cpp
  FBTiler.cpp
  IntegerHash.cpp
  KdTree.cpp)

set(facetbool_headers
  cgm/FBDefines.hpp
  cgm/FBStructs.hpp)

foreach (src IN LISTS facetbool_srcs)
  string(REGEX REPLACE ".cpp" ".hpp" header "${src}")
  list(APPEND facetbool_headers
    "cgm/${header}")
endforeach ()

cgm_add_library(cgm_facetbool 1 ${facetbool_srcs} ${facetbool_headers})
include_directories(cgm_facetbool
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/cgm
    ${CMAKE_SOURCE_DIR}/src/util/cgm
    ${CMAKE_BINARY_DIR}/src/util/cgm
)
target_link_libraries(cgm_facetbool
  PUBLIC
    cgm_util
)

install(
  TARGETS   "cgm_facetbool"
  EXPORT    cgm_geom
  RUNTIME   DESTINATION bin
  LIBRARY   DESTINATION lib
  ARCHIVE   DESTINATION lib
  COMPONENT Runtime)

cgm_install_headers(${facetbool_headers})

